#ifndef	QTUI_QT_PROJECT_VIEW_BASE_HPP
#define QTUI_QT_PROJECT_VIEW_BASE_HPP

#include "QtUI/QtUIConfig.hpp"
#include "AbsUI/ProjectView.hpp"
#include <boost/noncopyable.hpp>

namespace QtUI
{

	namespace Impl { class QtProjectViewImpl; }

/// @ingroup QtUI
/// @brief It adapts AbsUI::ProjectView interface to QT framework.
///
/// For more details, see @ref ViewMechanisms_QtIntegration "Integration of view mechanisms in QT framework"
class QTUI_API QtProjectViewBase: public AbsUI::ProjectView, private boost::noncopyable
{
	friend class Impl::QtProjectViewImpl;
public:
	/// @sa Abs::ProjectView::ProjectView
	QtProjectViewBase( Ctrl::ProjectController& ctrler);

	/// @brief It deletes the implementation object.
	virtual ~QtProjectViewBase();

	/// @brief It handles the project changing.
	/// 
	/// It emits the change project QT signal from the implementation object.
	virtual void changeProject( Model::Project* pNewProject);

	/// @brief It handles the project description changing.
	/// 
	/// It emits the project description change QT signal from the implementation object.
	virtual void changeProjectDescription( const Model::Project& changedProject);

protected:
	/// @brief It handles the project change event. Subclasses should specialize this method.
	///
	/// This handler is called asynchronously, in the UI thread.
	virtual void handleProjectChanged( Model::Project* pNewPrj) = 0;

	/// @brief It handles the project description change event. Subclasses should specialize this method.
	///
	/// This handler is called asynchronously, in the UI thread.
	virtual void handleProjectDescriptionChanged( const Model::Project& changedProject) = 0;

private:
	Impl::QtProjectViewImpl* pImpl_;
};

} // namespace QtUI

#endif // QTUI_QT_PROJECT_VIEW_BASE_HPP
